FROM ubuntu:18.04

ARG SOFTWARE_BASE_URL

COPY aliyun-apt-sources /etc/apt/sources.list

RUN apt update \
	&& apt install -y wget \
	&& apt install -y curl \
	&& apt install -y net-tools \
	&& apt install -y inetutils-ping \
	&& apt install -y nano \
	&& apt install -y unzip \
	&& apt-get clean && apt-get autoclean
    
RUN mkdir /app && cd /app \
    && wget -O jdk-8u261-linux-x64.tar.gz $SOFTWARE_BASE_URL/jdk-8u261-linux-x64.tar.gz \
    && tar -xzf jdk-8u261-linux-x64.tar.gz \
    && mv jdk1.8.0_261 /opt/jdk1.8.0_261 \
    && ln -s /opt/jdk1.8.0_261 /opt/jdk \
    && cd /  && rm -rf /app
   
ENV JAVA_HOME /opt/jdk
ENV PATH $JAVA_HOME/bin:$PATH
